#ifndef OPERATIONHELPER_H
#define OPERATIONHELPER_H

#include <string>
#include <QString>

class QTextCodec;

QTextCodec* detectEncoding(const QByteArray &bom);

// Copy original file content to backup file, copy the temp file content to original file.
int commitReplace(const QString &originalFilePath, const QString &tempFilePath);

QString tripControlCharacter( // Trip control character from the input string, and return a string for store in model.
	const QString::const_iterator &lineStart, 
	const QString::const_iterator &lineEnd, 
	const QString::const_iterator &resultHead, 
	const QString::const_iterator &resultTail);

QString tripControlCharacterDisp( // Trip control character from the input string, and return a string which will highlight the match content for display in tree view.
	const QString::const_iterator &lineStart, 
	const QString::const_iterator &lineEnd, 
	const QString::const_iterator &resultHead, 
	const QString::const_iterator &resultTail);

#endif // SEARCHHELPER_H
